#include "tabbuttonwidget.h"
#include "ui_tabbuttonwidget.h"

TabButtonWidget::TabButtonWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::TabButtonWidget)
{
    ui->setupUi(this);
    setToolTip(ui->text->text());
}

TabButtonWidget::~TabButtonWidget()
{
    delete ui;
}

void TabButtonWidget::setTabIcon(const QIcon &icon)
{
    this->ui->icon->setPixmap(icon.pixmap(20,20));
    this->ui->icon->setAlignment(Qt::AlignCenter);
}

void TabButtonWidget::setTabText(const QString &text)
{
    this->ui->text->setText(text);
}

void TabButtonWidget::updateWthatIs(QString str)
{
    this->ui->icon->setWhatsThis(str);
    this->ui->text->setWhatsThis(str);
}

void TabButtonWidget::on_close_btn_clicked()
{
    emit clickCloseBtn();
}

